use sax::Converter:: base64 code instead
authorCaolán McNamara <caolanm@redhat.com>
Wed, 30 May 2012 14:09:18 +0000 (14:09 +0000)
committerRene Engelhard <rene@debian.org>
Wed, 1 Aug 2012 08:41:17 +0000 (08:41 +0000)
Change-Id: I92fd4459bed7c38ff2063899b20d24d781ac45b

From b9f83fca37a3544b825de9d2f295090257d3477b Mon Sep 17 00:00:00 2001
From: Caolán McNamara <caolanm@redhat.com>
Date: Sat, 02 Jun 2012 22:14:45 +0000
Subject: ThreeByteToFourByte and friends are no longer in use

Change-Id: I9a2aaebfc5cc6b8b6327d61270043611283a6975

Gbp-Pq: Name CVE-2012-2665-binfilter.diff

18 files changed:
binfilter/bf_sc/source/filter/xml/sc_XMLChangeTrackingExportHelper.cxx
binfilter/bf_sc/source/filter/xml/sc_XMLTrackedChangesContext.cxx
binfilter/bf_sc/source/filter/xml/sc_xmlbodyi.cxx
binfilter/bf_sc/source/filter/xml/sc_xmlexprt.cxx
binfilter/bf_sc/source/filter/xml/sc_xmlsubti.cxx
binfilter/bf_sc/util/makefile.mk
binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx
binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx
binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx
binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx
binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx
binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx
binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx
binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx
binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx
binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx
binfilter/bf_xmloff/util/makefile.mk
binfilter/inc/bf_xmloff/xmluconv.hxx

index 2916fa79c0f419ae4fd26833df82c57dde5f0d98..4b878dc65fbfec8bb9408e3cbe3fd4d1291dca1f 100644 (file)
@@ -39,6 +39,9 @@
 #include <bf_xmloff/xmluconv.hxx>
 
 #include <bf_svtools/zforlist.hxx>
+
+#include <sax/tools/converter.hxx>
+
 namespace binfilter {
 
 #define SC_CHANGE_ID_PREFIX "ct"
@@ -758,7 +761,7 @@ void ScChangeTrackingExportHelper::CollectAndWriteChanges()
         if (pChangeTrack->IsProtected())
         {
             ::rtl::OUStringBuffer aBuffer;
-            SvXMLUnitConverter::encodeBase64(aBuffer, pChangeTrack->GetProtection());
+            ::sax::Converter::encodeBase64(aBuffer, pChangeTrack->GetProtection());
             if (aBuffer.getLength())
                 rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
         }
index 44564807ba8409408f3620db00956ab33a57f7d7..b5d495c41d237a56629e614a1567bf7b3111d225 100644 (file)
@@ -47,6 +47,9 @@
 #include <bf_svtools/zforlist.hxx>
 
 #include <com/sun/star/text/ControlCharacter.hpp>
+
+#include <sax/tools/converter.hxx>
+
 namespace binfilter {
 
 using namespace ::com::sun::star;
@@ -562,7 +565,7 @@ ScXMLTrackedChangesContext::ScXMLTrackedChangesContext( ScXMLImport& rInImport,
                 if (sValue.getLength())
                 {
                     uno::Sequence<sal_Int8> aPass;
-                    SvXMLUnitConverter::decodeBase64(aPass, sValue);
+                    ::sax::Converter::decodeBase64(aPass, sValue);
                     pChangeTrackingImportHelper->SetProtection(aPass);
                 }
             }
index fb518067ac2a268c0efc647530b4492bfec1a684..42a4e2e148b03f0197a59f90e5c63a7cb9ee5caa 100644 (file)
@@ -56,6 +56,9 @@
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 
 #include <sal/types.h>
+
+#include <sax/tools/converter.hxx>
+
 namespace binfilter {
 
 using namespace ::com::sun::star;
@@ -193,7 +196,7 @@ void ScXMLBodyContext::EndElement()
         {
             uno::Sequence<sal_Int8> aPass;
             if (sPassword.getLength())
-                SvXMLUnitConverter::decodeBase64(aPass, sPassword);
+                ::sax::Converter::decodeBase64(aPass, sPassword);
             pDoc->SetDocProtection(bProtected, aPass);
         }
         uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( GetScImport().GetModel(), uno::UNO_QUERY );
index 59e571aa41603b38e883290076772484f1faf6ec..6823ff720594d3ee1ec35847d83c538ded147d78 100644 (file)
@@ -86,6 +86,7 @@
 #include <com/sun/star/sheet/NamedRangeFlag.hpp>
 #include <com/sun/star/form/XFormsSupplier.hpp>
 #include <legacysmgr/legacy_binfilters_smgr.hxx>
+#include <sax/tools/converter.hxx>
 namespace binfilter {
 //! not found in unonames.hxx
 #define SC_STANDARDFORMAT "StandardFormat"
@@ -1213,7 +1214,7 @@ void ScXMLExport::SetBodyAttributes()
     {
         AddAttribute(XML_NAMESPACE_TABLE, XML_STRUCTURE_PROTECTED, XML_TRUE);
         ::rtl::OUStringBuffer aBuffer;
-        SvXMLUnitConverter::encodeBase64(aBuffer, pDoc->GetDocPassword());
+        ::sax::Converter::encodeBase64(aBuffer, pDoc->GetDocPassword());
         if (aBuffer.getLength())
             AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
     }
@@ -1285,7 +1286,7 @@ void ScXMLExport::_ExportContent()
                                     AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE);
                                     ::rtl::OUStringBuffer aBuffer;
                                     if (pDoc)
-                                        SvXMLUnitConverter::encodeBase64(aBuffer, pDoc->GetTabPassword(nTable));
+                                        ::sax::Converter::encodeBase64(aBuffer, pDoc->GetTabPassword(nTable));
                                     if (aBuffer.getLength())
                                         AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
                                 }
index b517fb0341a140def48ea7e0b30b034ce3b768c2..f53aacbfb5c332f211c403538cb8f9b8d66db16d 100644 (file)
@@ -45,6 +45,8 @@
 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
 #include <com/sun/star/sheet/XCellRangeMovement.hpp>
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+
+#include <sax/tools/converter.hxx>
 namespace binfilter {
 
 //------------------------------------------------------------------
@@ -593,7 +595,7 @@ void ScMyTables::DeleteTable()
     if (rImport.GetDocument() && bProtection)
     {
         uno::Sequence<sal_Int8> aPass;
-        SvXMLUnitConverter::decodeBase64(aPass, sPassword);
+        ::sax::Converter::decodeBase64SomeChars(aPass, sPassword);
         rImport.GetDocument()->SetTabProtection(nCurrentSheet, bProtection, aPass);
         /*uno::Reference <util::XProtectable> xProtectable(xCurrentSheet, uno::UNO_QUERY);
         if (xProtectable.is())
index bbe72863d45a0a7861b2f23806d2c64928364b93..ca55b96fc02236877910fd4feba474b691574b00 100644 (file)
@@ -71,6 +71,7 @@ SHL1STDLIBS+=       \
     $(BFSVXLIB)                \
     $(BFOFALIB)                \
     $(VCLLIB)          \
+    $(SAXLIB)          \
     $(CPPULIB)         \
     $(CPPUHELPERLIB)   \
     $(COMPHELPERLIB)   \
index 3ffa5d5536502d7c866d359d16c090aa82f75a83..e8b653883ab4e6daf584149e1acbc38551a14e7b 100644 (file)
@@ -37,9 +37,7 @@
 #include "xmluconv.hxx"
 #include <tools/debug.hxx>
 
-#ifndef __SGI_STL_LIST
 #include <list>
-#endif
 
 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
 #include <com/sun/star/container/XIndexContainer.hpp>
@@ -48,6 +46,7 @@
 #include <com/sun/star/util/DateTime.hpp>
 #include <com/sun/star/document/XViewDataSupplier.hpp>
 #include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <sax/tools/converter.hxx>
 #include <xmlenums.hxx>
 namespace binfilter {
 
@@ -516,8 +515,7 @@ void XMLConfigItemContext::Characters( const ::rtl::OUString& rChars )
             }
             uno::Sequence<sal_Int8> aBuffer((sChars.getLength() / 4) * 3 );
             sal_Int32 nCharsDecoded =
-                GetImport().GetMM100UnitConverter().
-                    decodeBase64SomeChars( aBuffer, sChars );
+                ::sax::Converter::decodeBase64SomeChars(aBuffer, sChars);
             sal_uInt32 nStartPos(aDecoded.getLength());
             sal_uInt32 nCount(aBuffer.getLength());
             aDecoded.realloc(nStartPos + nCount);
index a60824a3c7426149211edb29091e5a35cf9acf3e..f7fbcfd26bbf0bae62444fcbe7377231fb0e0546 100644 (file)
@@ -39,6 +39,7 @@
 #include <com/sun/star/util/DateTime.hpp>
 #include <com/sun/star/container/XIndexContainer.hpp>
 #include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <sax/tools/converter.hxx>
 #include <xmlenums.hxx>
 namespace binfilter {
 
@@ -355,7 +356,7 @@ void XMLSettingsExportHelper::exportbase64Binary(
     if(nLength)
     {
         ::rtl::OUStringBuffer sBuffer;
-        SvXMLUnitConverter::encodeBase64(sBuffer, aProps);
+        ::sax::Converter::encodeBase64(sBuffer, aProps);
         rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
     }
 }
index 73457cba26d431d3faf59be3606207dacf9f7fd7..5e8738ab2e7244fab2a263fb5d2459872d16cdde 100644 (file)
@@ -28,6 +28,7 @@
 
 
 #include <com/sun/star/io/XInputStream.hpp>
+#include <sax/tools/converter.hxx>
 
 #include "xmluconv.hxx"
 #include "xmlexp.hxx"
@@ -62,8 +63,7 @@ sal_Bool XMLBase64Export::exportXML( const Reference < XInputStream> & rIn )
             nRead = rIn->readBytes( aInBuff, INPUT_BUFFER_SIZE );
             if( nRead > 0 )
             {
-                GetExport().GetMM100UnitConverter().encodeBase64( aOutBuff,
-                                                                  aInBuff );
+                ::sax::Converter::encodeBase64(aOutBuff, aInBuff);
                 GetExport().Characters( aOutBuff.makeStringAndClear() );
                 if( nRead == INPUT_BUFFER_SIZE )
                     GetExport().IgnorableWhitespace();
index 0f46e86458d0f8e430e6c8274bed2656c5789f92..ced6fff05018842f425aa507150d8a59f1dd8551 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <com/sun/star/io/XOutputStream.hpp>
 
+#include <sax/tools/converter.hxx>
+
 #include "XMLBase64ImportContext.hxx"
 namespace binfilter {
 
@@ -82,8 +84,7 @@ void XMLBase64ImportContext::Characters( const ::rtl::OUString& rChars )
         }
         Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 );
         sal_Int32 nCharsDecoded =
-            GetImport().GetMM100UnitConverter().
-                decodeBase64SomeChars( aBuffer, sChars );
+            ::sax::Converter::decodeBase64SomeChars(aBuffer, sChars);
         xOut->writeBytes( aBuffer );
         if( nCharsDecoded != sChars.getLength() )
             sBase64CharsLeft = sChars.copy( nCharsDecoded );
index 4c7941f2da2529a5b65ca3dd9e706d0d78833f99..e25661be6abfe913786dca5c19c32d14d4af1174 100644 (file)
@@ -1454,181 +1454,6 @@ void SvXMLUnitConverter::convertVector3D( OUStringBuffer &rBuffer,
     rBuffer.append(sal_Unicode(')'));
 }
 
-const
-  sal_Char aBase64EncodeTable[] =
-    { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
-      'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
-      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
-      'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
-      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' };
-
-const
-  sal_uInt8 aBase64DecodeTable[]  =
-    {                                            62,255,255,255, 63, // 43-47
-//                                                +               /
-
-     52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255,  0,255,255, // 48-63
-//    0   1   2   3   4   5   6   7   8   9               =
-
-    255,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, // 64-79
-//        A   B   C   D   E   F   G   H   I   J   K   L   M   N   O
-
-     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, // 80-95
-//    P   Q   R   S   T   U   V   W   X   Y   Z
-
-      0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 96-111
-//        a   b   c   d   e   f   g   h   i   j   k   l   m   n   o
-
-     41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; // 112-123
-//    p   q   r   s   t   u   v   w   x   y   z
-
-
-
-void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, ::rtl::OUStringBuffer& sBuffer)
-{
-    sal_Int32 nLen(nFullLen - nStart);
-    if (nLen > 3)
-        nLen = 3;
-    if (nLen == 0)
-    {
-        return;
-    }
-
-    sal_Int32 nBinaer;
-    switch (nLen)
-    {
-        case 1:
-        {
-            nBinaer = ((sal_uInt8)pBuffer[nStart + 0]) << 16;
-        }
-        break;
-        case 2:
-        {
-            nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) +
-                    (((sal_uInt8)pBuffer[nStart + 1]) <<  8);
-        }
-        break;
-        default:
-        {
-            nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) +
-                    (((sal_uInt8)pBuffer[nStart + 1]) <<  8) +
-                    ((sal_uInt8)pBuffer[nStart + 2]);
-        }
-        break;
-    }
-
-    sal_Unicode buf[4] = { '=', '=', '=', '=' };
-
-    sal_uInt8 nIndex ((nBinaer & 0xFC0000) >> 18);
-    buf[0] = aBase64EncodeTable [nIndex];
-
-    nIndex = (nBinaer & 0x3F000) >> 12;
-    buf[1] = aBase64EncodeTable [nIndex];
-    if (nLen > 1)
-    {
-        nIndex = (nBinaer & 0xFC0) >> 6;
-        buf[2] = aBase64EncodeTable [nIndex];
-        if (nLen > 2)
-        {
-            nIndex = (nBinaer & 0x3F);
-            buf[3] = aBase64EncodeTable [nIndex];
-        }
-    }
-    sBuffer.append(buf, SAL_N_ELEMENTS(buf));
-}
-
-void SvXMLUnitConverter::encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& aPass)
-{
-    sal_Int32 i(0);
-    sal_Int32 nBufferLength(aPass.getLength());
-    const sal_Int8* pBuffer = aPass.getConstArray();
-    while (i < nBufferLength)
-    {
-        ThreeByteToFourByte (pBuffer, i, nBufferLength, aStrBuffer);
-        i += 3;
-    }
-}
-
-void SvXMLUnitConverter::decodeBase64(uno::Sequence<sal_Int8>& aBuffer, const ::rtl::OUString& sBuffer)
-{
-#if OSL_DEBUG_LEVEL > 0
-    sal_Int32 nCharsDecoded =
-#endif
-        decodeBase64SomeChars( aBuffer, sBuffer );
-    OSL_ENSURE( nCharsDecoded == sBuffer.getLength(),
-                "some bytes left in base64 decoding!" );
-}
-
-sal_Int32 SvXMLUnitConverter::decodeBase64SomeChars(
-        uno::Sequence<sal_Int8>& rOutBuffer,
-        const ::rtl::OUString& rInBuffer)
-{
-    sal_Int32 nInBufferLen = rInBuffer.getLength();
-    sal_Int32 nMinOutBufferLen = (nInBufferLen / 4) * 3;
-    if( rOutBuffer.getLength() < nMinOutBufferLen )
-        rOutBuffer.realloc( nMinOutBufferLen );
-
-    const sal_Unicode *pInBuffer = rInBuffer.getStr();
-    sal_Int8 *pOutBuffer = rOutBuffer.getArray();
-    sal_Int8 *pOutBufferStart = pOutBuffer;
-    sal_Int32 nCharsDecoded = 0;
-
-    sal_uInt8 aDecodeBuffer[4];
-    sal_Int32 nBytesToDecode = 0;
-    sal_Int32 nBytesGotFromDecoding = 3;
-    sal_Int32 nInBufferPos= 0;
-    while( nInBufferPos < nInBufferLen )
-    {
-        sal_Unicode cChar = *pInBuffer;
-        if( cChar >= '+' && cChar <= 'z' )
-        {
-            sal_uInt8 nByte = aBase64DecodeTable[cChar-'+'];
-            if( nByte != 255 )
-            {
-                // We have found a valid character!
-                aDecodeBuffer[nBytesToDecode++] = nByte;
-
-                // One '=' character at the end means 2 out bytes
-                // Two '=' characters at the end mean 1 out bytes
-                if( '=' == cChar && nBytesToDecode > 2 )
-                    nBytesGotFromDecoding--;
-                if( 4 == nBytesToDecode )
-                {
-                    // Four characters found, so we may convert now!
-                    sal_uInt32 nOut = (aDecodeBuffer[0] << 18) +
-                                      (aDecodeBuffer[1] << 12) +
-                                      (aDecodeBuffer[2] << 6) +
-                                       aDecodeBuffer[3];
-
-                    *pOutBuffer++  = (sal_Int8)((nOut & 0xff0000) >> 16);
-                    if( nBytesGotFromDecoding > 1 )
-                        *pOutBuffer++  = (sal_Int8)((nOut & 0xff00) >> 8);
-                    if( nBytesGotFromDecoding > 2 )
-                        *pOutBuffer++  = (sal_Int8)(nOut & 0xff);
-                    nCharsDecoded = nInBufferPos + 1;
-                    nBytesToDecode = 0;
-                    nBytesGotFromDecoding = 3;
-                }
-            }
-            else
-            {
-                nCharsDecoded++;
-            }
-        }
-        else
-        {
-            nCharsDecoded++;
-        }
-
-        nInBufferPos++;
-        pInBuffer++;
-    }
-    if( (pOutBuffer - pOutBufferStart) != rOutBuffer.getLength() )
-        rOutBuffer.realloc( pOutBuffer - pOutBufferStart );
-
-    return nCharsDecoded;
-}
-
 sal_Bool SvXMLUnitConverter::convertNumFormat(
         sal_Int16& rType,
         const OUString& rNumFmt,
index ffb638e1a5fbc56fa29504920f57b9b497bf394c..963716d567d647319394de8d54ae39527a852f27 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <com/sun/star/util/DateTime.hpp>
 
+#include <sax/tools/converter.hxx>
 
 #include "xmlnmspe.hxx"
 
@@ -238,7 +239,7 @@ void XMLRedlineExport::ExportChangesListElements()
         if ( aKey.getLength() > 0 )
         {
             OUStringBuffer aBuffer;
-            SvXMLUnitConverter::encodeBase64( aBuffer, aKey );
+            ::sax::Converter::encodeBase64(aBuffer, aKey);
             rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_PROTECTION_KEY,
                                   aBuffer.makeStringAndClear() );
         }
index 59456bcf018452214422f65ebf1f8a4ff00e2a6b..348a70eaddab938a9fd162f02715a5ed2fcffdd1 100644 (file)
@@ -39,6 +39,8 @@
 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
 #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
 
+#include <sax/tools/converter.hxx>
+
 #include "xmlkywd.hxx"
 #include "xmluconv.hxx"
 #include "xmlexp.hxx"
@@ -452,7 +454,7 @@ void XMLSectionExport::ExportRegularSectionStart(
     if (aPassword.getLength() > 0)
     {
         OUStringBuffer aBuffer;
-        SvXMLUnitConverter::encodeBase64(aBuffer, aPassword);
+        ::sax::Converter::encodeBase64(aBuffer, aPassword);
         GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTION_KEY,
                                  aBuffer.makeStringAndClear());
     }
index ebd58bb1cf73083cd96c85d1bf74da5c954ed436..e31b32848a8ee3f9a398d26103eb6c41495b28ce 100644 (file)
@@ -40,6 +40,8 @@
 #include <com/sun/star/text/XTextContent.hpp>
 #include <com/sun/star/text/ControlCharacter.hpp>
 
+#include <sax/tools/converter.hxx>
+
 namespace binfilter {
 
 
@@ -308,7 +310,7 @@ void XMLSectionImportContext::ProcessAttributes(
                 }
                 break;
             case XML_TOK_SECTION_PROTECTION_KEY:
-                SvXMLUnitConverter::decodeBase64(aSequence, sAttr);
+                ::sax::Converter::decodeBase64(aSequence, sAttr);
                 bSequenceOK = sal_True;
                 break;
             case XML_TOK_SECTION_PROTECT:
index 33dfe6cf3e2de700895b83bf5242b7e38b9bfa22..39fde1ff686a407207ed60433e7f687a858f8080 100644 (file)
@@ -35,6 +35,7 @@
 #include <com/sun/star/io/XOutputStream.hpp>
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
+#include <sax/tools/converter.hxx>
 #include "xmlimp.hxx"
 #include "xmlnmspe.hxx"
 #include "xmlkywd.hxx"
@@ -1111,8 +1112,7 @@ void XMLTextFrameContext::Characters( const OUString& rChars )
                 }
                 Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 );
                 sal_Int32 nCharsDecoded =
-                    GetImport().GetMM100UnitConverter().
-                        decodeBase64SomeChars( aBuffer, sChars );
+                    ::sax::Converter::decodeBase64SomeChars(aBuffer, sChars);
                 xBase64Stream->writeBytes( aBuffer );
                 if( nCharsDecoded != sChars.getLength() )
                     sBase64CharsLeft = sChars.copy( nCharsDecoded );
index d24d31c5dbeade8f40d4cd13c2b5c0f55ab66d56..b5f3bbf65fb7078e80a6ba3f0f7f74812896f772 100644 (file)
@@ -30,6 +30,7 @@
 #include "XMLChangedRegionImportContext.hxx"
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/uno/Sequence.h>
+#include <sax/tools/converter.hxx>
 #include "xmlimp.hxx"
 #include "xmlnmspe.hxx"
 #include "nmspmap.hxx"
@@ -84,7 +85,7 @@ void XMLTrackedChangesImportContext::StartElement(
             }
             else if ( IsXMLToken( sLocalName, XML_PROTECTION_KEY ) )            {
                 Sequence<sal_Int8> aSequence;
-                SvXMLUnitConverter::decodeBase64(
+                ::sax::Converter::decodeBase64(
                     aSequence, xAttrList->getValueByIndex(i));
                 if ( aSequence.getLength() > 0 )
                 {
index ff6b5449314336f71f12339e723401d54d327c73..bb803a65d833d35b0ae9d165345402e6cb2cee00 100644 (file)
@@ -69,6 +69,7 @@ SHL1IMPLIB= _ibf_xo
 
 SHL1STDLIBS= \
         $(BFSVTOOLLIB) \
+        $(SAXLIB)              \
         $(TOOLSLIB)            \
         $(I18NISOLANGLIB) \
         $(CPPULIB)             \
index 71dd84be550788cfaf418a760352b8b487689cf2..d0d45aeb54422c001fa4a5bad3e0adc6d79bcd63 100644 (file)
@@ -309,17 +309,6 @@ public:
     static sal_Int32 indexOfComma( const ::rtl::OUString& rStr,
                                    sal_Int32 nPos );
 
-    static void encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const ::com::sun::star::uno::Sequence<sal_Int8>& aPass);
-
-    // Decode a base 64 encoded string into a sequence of bytes. The first
-    // version can be used for attribute values only, bacause it does not
-    // return any chars left from conversion.
-    // For text submitted throgh the SAX characters call, the later method
-    // must be used!
-    static void decodeBase64( ::com::sun::star::uno::Sequence<sal_Int8>& aPass, const ::rtl::OUString& sBuffer);
-
-    static sal_Int32 decodeBase64SomeChars( ::com::sun::star::uno::Sequence<sal_Int8>& aPass, const ::rtl::OUString& sBuffer);
-
     /** convert num-forat and num-letter-sync values to NumberingType */
     sal_Bool convertNumFormat( sal_Int16& rType,
                                 const ::rtl::OUString& rNumFormat,